<?php
class App_Source_Media_Entity extends Mozg_Property_Params
{
	public function GetThumbNail($getDefault = false)
	{
		$thumb = $this->Get('thumbNail');
		if (!$thumb && $getDefault)
		{
			$thumb = Mozg_Cfg::Get('global/media')->GetMediaImageFolder().Mozg_Cfg::Get('global/media')->Get($this->GetType(). '_defaultThumbNail');
		}

		return $thumb;
	}

	public function GetStatusName()
	{
		return App_Source_Media_Status::Get($this->Get('status'));
	}

	public function GetFileCustom()
	{
		if ($this->HasSet('fileCustom')) return $this->Get('fileCustom');
		return array('file' => $this->GetFile());
	}

	public function GetThumbCustom()
	{
		if ($this->HasSet('thumbCustom')) return $this->Get('thumbCustom');
		return array('file' => $this->Get('thumbNail'));
	}
}